ADD_DEFINITIONS (-DDLL_HAL_EXPORTS)

IF (WIN32)
    SET (OS_DIR win7)
ELSE (WIN32)
    SET (OS_DIR ubuntu)
ENDIF (WIN32)
FILE (GLOB EXTRA_C_SOURCES ${PROJECT_SOURCE_DIR}/src/ref-impl/hal/os/${OS_DIR}/*.c)

INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/include/exports)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/include/imports)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/log)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/system)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/system/facility)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/utils)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/utils/digest)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/infra/utils/misc)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/os)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/os/macos)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/os/ubuntu)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/os/win7)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/ssl)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/ssl/itls)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/ssl/mbedtls)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/hal/ssl/openssl)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/tls/)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/tls/include)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/tls/include/mbedtls)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/ref-impl/tls/library)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/security/pro/)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/security/pro/crypto)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/security/pro/id2)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/security/pro/itls)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/security/pro/km)

FILE (GLOB src_ref-impl_hal_SRCS
    ${PROJECT_SOURCE_DIR}/src/ref-impl/hal/ssl/mbedtls/*.c
)

ADD_LIBRARY (iot_hal SHARED
    ${src_ref-impl_hal_SRCS}
    ${EXTRA_C_SOURCES}
)

TARGET_LINK_LIBRARIES (iot_hal iot_tls)

SET (LIBRARY_OUTPUT_PATH ../../../out)

